const express = require('express')
const history = require('connect-history-api-fallback')
const app = express()

/* app.use((request, response, next) => {
  console.log('有人请求服务器3了')
  next()
}) */

app.use(history())
app.use(express.static(__dirname + '/static'))

app.get('/demo', (request, response) => {
  const students = [
    {
      id: '001',
      name: 'lqj',
      age: 18
    },
    {
      id: '002',
      name: 'tjc',
      age: 18
    }
  ]
  response.send(students)
})

app.listen(1997, err => {
  if(!err) console.log('服务器3启动成功了，请求地址为： http://localhost:1997/demo')
})